<?php                             
require_once(dirname(__FILE__) . "/../../jdcr/php/gen/BaseEnum.inc.php");

abstract class CryptographicSequence extends BaseEnum {     
  const csA = 0;
  const csB = 1;
}

function ck2ha($aCryptographicKey, $aPart) {
  $ck = explode("|",$aCryptographicKey);

  switch ($aPart) {
    case CryptographicSequence::csA: $ck = $ck[0]; break;
    case CryptographicSequence::csB: $ck = $ck[1]; break;
  }

  $ck = explode(";",$ck);

  foreach ($ck as $ha) {
    $result[] = intval($ha); 
  }
  
  return $result; 
}

function getFullCk($aCryptographicKey) {
  return explode(";",str_replace("|",";",$aCryptographicKey));
}
//var_dump(CK2HA("2;4;6|1;3;5",CryptographicSequence::csA));
//var_dump(getFullCk("2;4;6|1;3;5"));
?>
